from django.conf.urls.defaults import *
from django.conf import settings

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns=patterns(
    'avanza.avanzaweb.views',
    (r'^$',  'index'),
    (r'^contacto/',  'frmContacto'),
    (r'^cn/(?P<cn>\w+)$',  'contenido'),
    (r'^promo/(?P<pr>\d+)$',  'promocion'),
    (r'^cuestionario$',  'cuestionario'),
    (r'^cuestionario/(?P<pr>\d+)$',  'cuestionario'),
    (r'^eclientes$',  'estadistica'),
    url(r'^promo/(?P<pr>\d+)/(?P<pdf>\d+)$',  'promocion', name='pdf'),

)

urlpatterns += patterns('',
     (r'^accounts/login/$', 'django.contrib.auth.views.login',  {'template_name': 'mdm/login.html'}),
     (r'^admin/', include(admin.site.urls)),
     (r'^mdm/',  include('avanza.mdm.urls')),

)

if settings.DEBUG:
    urlpatterns += patterns('',
    #~ (r'^site_media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': os.path.join(os.path.dirname(__file__), '/public/site_media/').replace('\\','/')}),
    (r'^site_media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
)



